<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.6 -->
  <link rel="stylesheet" href="/static/adminlte/bootstrap/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="/static/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" type="text/css" href="/static/css/ionicons.min.css" />
  <!-- Theme style -->
  <link rel="stylesheet" href="/static/adminlte/dist/css/AdminLTE.min.css">
		<title></title>
	</head>
	<body>

<section class="content">
      <div class="row">
		<div class="col-xs-12">
		          <div class="nav-tabs-custom">
		            <ul class="nav nav-tabs">
		              <li class="active"><a>文章管理</a></li>
		              <li><a href="{:url('admin/article/add')}">添加文章</a></li>
		            </ul>
		            <div class="tab-content">
		            	<div class="row">
		            		
							<div class="col-xs-12">
								<form action="{:url('article/index')}" method="get">
					            	<div class="input-group pull-left" style="width: 300px;margin-right: 5px;">
									    <span class="input-group-addon">分类</span>
				                        <select name="cid" class="form-control">
				                            <option value="0">全部</option>
				                            {foreach name="category_level_list" item="vo"}
				                            <option value="{$vo.id}" {if condition="$cid==$vo.id"} selected="selected"{/if}>{neq name="vo.level" value="1"}|{php}for($i=1;$i<$vo['level'];$i++){echo ' ----';}{/php}{/neq} {$vo.name}</option>
				                            {/foreach}
				                        </select>
									</div>
					            	<div class="input-group pull-left" style="width: 300px;margin-right: 5px;">
									  <span class="input-group-addon">关键词</span>
									  <input type="text" class="form-control" name="keyword" value="{$keyword}" placeholder="请输入关键字">
									</div>
									<div class="input-group">
										<button type="submit" class="btn btn-info btn-flat">搜索</button>
									</div>
								</form>
								<hr style="margin-top: 10px;margin-bottom: 10px;" />
							</div>
							<form action="" method="post" class="ajax-form">
								<div class="col-xs-12">
									<button type="button" class="btn btn-primary btn-flat ajax-action" data-action="{:url('admin/article/toggle',['type'=>'audit'])}">审核</button>
									<button type="button" class="btn btn-warning btn-flat ajax-action" data-action="{:url('admin/article/toggle',['type'=>'cancel_audit'])}">取消审核</button>
									<button type="button" class="btn btn-danger btn-flat ajax-action" data-action="{:url('admin/article/delete')}">删除</button>	
								</div>
								<div class="col-xs-12">
				                    <table class="table">
				                        <thead>
				                        <tr>
				                            <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
				                            <th style="width: 30px;">ID</th>
				                            <th style="width: 30px;">排序</th>
				                            <th>标题</th>
				                            <th>栏目</th>
				                            <th>作者</th>
				                            <th>阅读量</th>
				                            <th>状态</th>
				                            <th>发布时间</th>
				                            <th>操作</th>
				                        </tr>
				                        </thead>
				                        <tbody>
				                        {foreach name="article_list" item="vo"}
				                        <tr>
				                            <td><input type="checkbox" name="ids[]" value="{$vo.id}"></td>
				                            <td>{$vo.id}</td>
				                            <td>{$vo.sort}</td>
				                            <td>{$vo.title}</td>
				                            <td>{$category_list[$vo['cid']]}</td>
				                            <td>{$vo.author}</td>
				                            <td>{$vo.reading}</td>
				                            <td>{php}echo $vo['status']==1 ? '已审核' : '未审核';{/php}</td>
				                            <td>{$vo.publish_time}</td>
				                            <td>
				                                <a href="{:url('admin/article/edit',['id'=>$vo['id']])}" class="label label-success">编辑</a>
				                                <a href="{:url('admin/article/delete',['id'=>$vo['id']])}" class="label label-danger ajax-delete">删除</a>
				                            </td>
				                        </tr>
				                        {/foreach}
				                        </tbody>
				                    </table>
				                    <!--分页-->
				                    {$article_list->render()}				                    
								</div><!--/col-->
							</form>
		     			</div><!--/row-->

		            </div><!-- /.tab-content -->
		          </div><!-- /.nav-tabs-custom -->
		</div><!--/.row-->
      </div>
  </section>
<!-- jQuery 2.2.3 -->
<script src="/static/adminlte/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="/static/layer/layer.js" type="text/javascript" charset="utf-8"></script>
<!-- Bootstrap 3.3.6 -->
<script src="/static/adminlte/bootstrap/js/bootstrap.min.js"></script>
<script src="/static/js/admin.js"></script>
	</body>
</html>
